home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / printing / scriptable print simpletext / macincludes.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  3.5 KB  |  135 lines

  1. /*
  2. **    File:        MacIncludes.h
  3. **
  4. **    Contains:    This file contains all of the Mac includes that one needs
  5. **
  6. **    Version:    SimpleText 1.4 or later
  7. **
  8. ** Copyright 1993-1999 Apple Computer. All rights reserved.
  9. **
  10. **    You may incorporate this sample code into your applications without
  11. **    restriction, though the sample code has been provided "AS IS" and the
  12. **    responsibility for its operation is 100% yours.  However, what you are
  13. **    not permitted to do is to redistribute the source as "DSC Sample Code"
  14. **    after having made changes. If you're going to re-distribute the source,
  15. **    we require that you make it clear in the source that the code was
  16. **    descended from Apple Sample Code, but that you've made changes.
  17.  
  18. */
  19.  
  20.  
  21. #ifndef __MACINCLUDES__
  22. #define __MACINCLUDES__
  23.  
  24. #ifndef BUILDING_FOR_SYSTEM7
  25. #define BUILDING_FOR_SYSTEM7 1
  26. #endif
  27.  
  28. #include <StdArg.h>
  29. #include <Limits.h>
  30. #include <Types.h>
  31. #include <Resources.h>
  32. #include <QuickDraw.h>
  33. #include <Fonts.h>
  34. #include <Events.h>
  35. #include <Windows.h>
  36. #include <Menus.h>
  37. #include <TextEdit.h>
  38. #include <Dialogs.h>
  39. #include <ToolUtils.h>
  40. #include <Memory.h>
  41. #include <SegLoad.h>
  42. #include <Files.h>
  43. #include <OSUtils.h>
  44. #include <Traps.h>    
  45. #include <Script.h>
  46. #include <ColorPicker.h>
  47. #include <FixMath.h>
  48. #include <Packages.h>
  49. #include <Math.h>
  50. #include <Palettes.h>
  51. #include <QDOffscreen.h>
  52. #include <DeskBus.h>
  53. #include <StdLib.h>
  54. #include <StdArg.h>
  55. #include <Strings.h>
  56. #include <StdIO.h>
  57. #include <Sound.h>
  58. #include <Errors.h>
  59. #include <AppleEvents.h>
  60. #include <DiskInit.h>
  61. #include <Retrace.h>
  62. #include <Folders.h>
  63. #include <Lists.h>
  64. #include <CTBUtilities.h>
  65. #include <Gestalt.h>
  66. #include <Finder.h>
  67. #include <Scrap.h>
  68. #include <Devices.h>
  69. #include <Video.h>
  70. #include <Aliases.h>
  71. #include <SoundInput.h>
  72. #include <Movies.h>
  73. #include <Printing.h>
  74. #include <Balloons.h>
  75. #include <MixedMode.h>
  76. #include <Drag.h>
  77. #include <TSMTE.h>
  78. #include <AppleGuide.h>
  79. #include <Speech.h>
  80. #include <Icons.h>
  81. #include <LowMem.h>
  82. #include <CodeFragments.h>
  83. #include <TextUtils.h>
  84.  
  85. // Balloons.h
  86. #define kDefaultBalloonVariant    2
  87.  
  88. /*
  89. // Fonts.h
  90. #if !GENERATINGPOWERPC
  91.     pascal short GetDefFontSize(void)
  92.     = {0x3EB8,0x0BA8,0x6604,0x3EBC,0x000C};
  93. #endif
  94. */
  95.  
  96. // For looking at all of our windows, not just the visible ones.
  97. #define    LMGetFirstWindow() (* (WindowRef*) 0x9D6)
  98.  
  99. // No glue for this either, sigh.
  100. #define TESetClickLoop(L,H) ((**(H)).clickLoop = (L))
  101.  
  102. // defines I like to use all of the time
  103. extern void _DataInit();        // part of Runtime library
  104.  
  105. #define TopLeft(aRect)    (* (Point *) &(aRect).top)
  106. #define BotRight(aRect)    (* (Point *) &(aRect).bottom)
  107.  
  108. #define RectWidth(aRect) ((aRect).right - (aRect).left)
  109. #define RectHeight(aRect) ((aRect).bottom - (aRect).top)
  110.  
  111. #define Max(X, Y) ( ((X)>(Y)) ? (X) : (Y) )
  112. #define Min(X, Y) (  ((X)>(Y)) ? (Y) : (X) )
  113.  
  114. #define Pin(VALUE, MIN, MAX) ( ((VALUE) < (MIN)) ? (MIN) : ( ((VALUE) > (MAX)) ? (MAX) : (VALUE) ) )
  115.  
  116. #define nrequire(CONDITION, LABEL) if (true) {if ((CONDITION)) goto LABEL; }
  117. #define require(CONDITION, LABEL) if (true) {if (!(CONDITION)) goto LABEL; }
  118.  
  119. // The Pascal equivalent of strcpy, takes two Pascal string pointers
  120. #define PSTRCPY(P1, P2)    BlockMove(P2, P1, P2[0]+1)
  121.  
  122. // Concatante one character C onto the string S 
  123. #define CHARCAT(S, C)    S[(S[0]+1)] = C; S[0]++;
  124.  
  125. /* The Pascal equivalent of strcat, takes two Pascal string pointers */
  126. #define PSTRCAT(P1, P2)                         \
  127.     BlockMove(&P2[1], &P1[(P1[0]+1)], P2[0]);    \
  128.     P1[0] += P2[0];
  129.  
  130. #if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION < 0x300)
  131. #define CheckMenuItem(menu, item, checked) CheckItem(menu, item, checked)
  132. #endif
  133.  
  134. #endif /* __MACINCLUDES__ */
  135.